<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增序列内容')" />
	<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-segment-add">
			<div class="form-group">	
				<label class="col-sm-2 control-label is-required">命名空间：</label>
				<div class="col-sm-10">
					<input id="namespace" name="namespace" class="form-control" type="text" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label is-required">初始值：</label>
				<div class="col-sm-10">
					<input id="leafVal" name="leafVal" class="form-control" value="0" min="0"  step="10000" type="number" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label is-required">初始步长：</label>
				<div class="col-sm-10">
					<input id="step" name="step" class="form-control" value="1000" min="100" max="1000000" step="1000" type="number" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label is-required">重试次数：</label>
				<div class="col-sm-10">
					<input id="retry" name="retry" class="form-control" type="number" value="10" min="6" max="20" step="1" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label is-required">递增数：</label>
				<div class="col-sm-10">
					<input id="delta" name="delta" class="form-control" type="number" value="1" min="1" max="10" step="1000" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label is-required">余数：</label>
				<div class="col-sm-10">
					<input id="remainder" name="remainder" class="form-control" type="number" value="0" min="0" max="9" step="1000" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">备注：</label>
				<div class="col-sm-10">
					<input id="remark" name="remark" class="form-control" type="text">
				</div>
			</div>
		</form>
	</div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <script type="text/javascript">
        var prefix = ctx + "leaf/segment";

	    $('.summernote').summernote({
	    	placeholder: '请输入内容',
			height : 192,
			lang : 'zh-CN',
			followingToolbar: false,
			callbacks: {
            }
		});

		$("#form-segment-add").validate({
			focusCleanup: true
		});
		function submitHandler() {
	        if ($.validate.form()) {
	        	var sHTML = $('.summernote').summernote('code');
				$("#remark").val(sHTML);
				$.operate.save(prefix + "/add", $('#form-segment-add').serialize());
	        }
	    }
	</script>
</body>
</html>
